package com.ThreadStudy.State;

import java.util.Calendar;
import java.util.Date;

/*
*
*
* 模拟倒计时
*
* */
public class TestSleep2{


    public static void main(String[] args) throws InterruptedException {
        (new TestSleep2()).countDown();
    }

    // 模拟倒计时
    public void countDown() throws InterruptedException {
        int num = 10;
        while (true){
            Thread.sleep(1000);
            System.out.println(num--);
            if (num<=0){
                break;
            }
        }
    }
}
